From 0f07569d157834b25a67ff49bf68fb46932a206f Mon Sep 17 00:00:00 2001 From: Alastair Tse Date: Fri, 1 Dec 2006 17:37:42 +0000 Subject: [PATCH] [XEND] Re-add vtpm device support in XendConfig This patch re-adds a recently removed vTPM device handling code. I am also removing that one code part in the test script that does not work. Signed-off-by: Stefan Berger --- tools/python/scripts/xapi.py | 2 -- tools/python/xen/xend/XendConfig.py | 12 +++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py index 07d886698b..06baeefe4c 100644 --- a/tools/python/scripts/xapi.py +++ b/tools/python/scripts/xapi.py @@ -446,8 +446,6 @@ def xapi_vtpm_create(*args): print "Has driver type '%s'" % driver vtpm_rec = execute(server.VTPM.get_record, session, vtpm_uuid) print "Has vtpm record '%s'" % vtpm_rec - vm = execute(server.VTPM.get_VM, session, vtpm_uuid) - print "Has VM '%s'" % vm # diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index 5733abf34c..3e4df3183f 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -945,7 +945,17 @@ class XendConfig(dict): self['devices'][dev_uuid] = (dev_type, dev_info) self['vbd_refs'].append(dev_uuid) return dev_uuid - + + elif dev_type in ('vtpm'): + if cfg_xenapi.get('type'): + dev_info['type'] = cfg_xenapi.get('type') + + dev_uuid = cfg_xenapi.get('uuid', uuid.createString()) + dev_info['uuid'] = dev_uuid + self['devices'][dev_uuid] = (dev_type, dev_info) + self['vtpm_refs'].append(dev_uuid) + return dev_uuid + return '' def device_update(self, dev_uuid, cfg_sxp): -- 2.30.2